package com.atguigu01._this.exer1;

/**
 * ClassName: PersonTest
 * Description:
 *
 * @Author liu
 * @Create 2024/10/25 10:17
 * @Version 1.0
 */
public class boy{
    private String name;
    private int age;

    //private的get set
    public void setName(String i){
        this.name =i;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int i) {
        this.age = i;
    }

    //构造器
    public boy(){

    }
    public boy(String name, int age){
     this.name = name;
     this.age = age;
    }

    public void marry(Girl girl){
        System.out.println("我想娶"+girl.getName());
    }
    public void shout( ){
        if(this.age >=22){
            System.out.println("我终于可以结婚了");
        }
        System.out.println("你暂时还不可以");

    }
}
